<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table {
            width: 80%;
            margin: 20px auto;
            border-collapse: collapse;
            font-family: Arial, sans-serif; /* 字体 */
        }

        th,td {
            background: wheat;
            border-bottom: 1px solid #ddd;
            border-left: 1px solid #ddd;
            border-right: 1px solid #ddd;
            padding: 10px;
            text-align: center; /* 中央对齐 */
        }
        td {
            background: white;
            color: #555;
        }
        #order{
            left: 45%;
            position: absolute;
            display: table-cell;
            vertical-align: middle;
            text-align: center;
        }
        a{
         color: #31b0d5;
        }
    </style>
</head>
<body>
<div th:replace="head"></div>

<div class="page-header">
    <div class="container">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="page-caption">
                    <h2 class="page-title">购物车</h2>
                    <p>Healthy & delicious cuisine</p>
                </div>
            </div>
        </div>
    </div>
</div>
    <table >
        <tr>
            <th>id</th>
            <th>图片</th>
            <th>菜名</th>
            <th>价格</th>
            <th>操作</th>
        </tr>
        <tr th:each="c:${cartlist}">
            <td  th:text="${c.cartid}"></td>
            <td width="420"><img th:src="${c.img}"  height="180" width="320"></td>
            <td th:text="${c.name}" width="350"></td>
            <td th:text="${c.price}" width="300"></td>
            <td><a th:href="@{'/cart/delete/'+${c.cartid}}">删除</a></td>
        </tr>
    </table>
    <div id="order"><a  th:href="@{'/order/createorder'}">创建订单</a></div>
    <a th:href="@{/user/tomain}">返回</a>
<div th:replace="footer"></div>
</body>
</html>